import { api as viewerApi } from 'v-viewer';
import { ref } from 'vue';
const viewerDom = ref();
export const openViewerImage = (images: Array<string>, index?: number) => {
  viewerDom.value = viewerApi({
    options: {
      toolbar: {
        zoomIn: true,
        zoomOut: true,

        prev: true,
        play: true,
        next: true,
        reset: true,
        rotateLeft: false,
        rotateRight: false,
        flipHorizontal: false,
        flipVertical: false,
      }, //
      //   rotatable: false,
      title: false,

      zIndex: 102790, //组件层级
      initialViewIndex: index ? index : 0, //当前展示的下标
    },
    images: images,
  });
};
